.editor-html-toolbar {
	height: 39px;
	position: relative;
	z-index: z-index( 'root', '.editor-html-toolbar' );

	.editor-html-toolbar__wrapper {
		background-color: rgba( var( --color-surface-rgb ), 0.92 );
		border-color: var( --color-neutral-10 );
		border-style: solid;
		border-left-width: 1px;
		border-right-width: 1px;
		border-bottom-width: 1px;
		box-sizing: border-box;
		margin: 0 auto;
		max-width: 700px;
		position: relative;
		width: 100%;

		@media ( max-width: 700px ) {
			border-left-width: 0;
			border-right-width: 0;
		}

		.focus-sidebar & {
			@media screen and ( max-width: ( 700px + $sidebar-width-max ) ) {
				border-left-width: 0;
				border-right-width: 0;
			}
  		}
	}

	&.is-pinned .editor-html-toolbar__wrapper {
		border-left-width: 0;
		border-right-width: 0;
		border-top-width: 0;
		max-width: none;
		position: fixed;
		top: 46px;
		width: 100%;
		z-index: 2;

		.focus-sidebar &,
		.has-chat & {
			width: calc( 100% - ( #{ $sidebar-width-max + 1 } ) );
		}

		.focus-sidebar.has-chat & {
			width: calc( 100% - ( #{ ( $sidebar-width-max * 2 ) + 1 } ) );
			left: 0;
		}

		@include breakpoint-deprecated( '660px-960px' ) {
			.focus-sidebar &,
			.has-chat & {
				width: calc( 100% - ( #{ $sidebar-width-max + 1 } ) );
			}

			.focus-sidebar.has-chat & {
				width: calc( 100% - ( #{ ( $sidebar-width-max * 2 ) + 1 } ) );
			}
		}
	}

	.editor-html-toolbar__wrapper-buttons {
		margin: 0 auto;
		max-width: 700px;
		position: relative;
		width: 100%;
	}

	.editor-html-toolbar__buttons {
		overflow-x: auto;
		white-space: nowrap;
		width: 100%;

		button {
			border-radius: 0;
		}
	}

	&.is-scrollable .editor-html-toolbar__buttons::after {
		@include long-content-fade();

		height: 36px;
		margin-top: 1px;
		transition: width 0.2s;
	}
	&.is-scrollable.is-scrolled-full .editor-html-toolbar__buttons::after {
		width: 0;
	}

	&.has-active-drop-zone {
		/*
		 * Allow the dropzone to overflow the toolbar and expand to fill the entire editor body.
		 * `static` prevents `.html-editor-toolbar` from setting the positioning context for its
		 * children (including the dropzone), which would constrain them to the dimensions of the
		 * toolbar. Instead, it will be constrained to the next highest positioned element,
		 * `.tinymce-container.`
		 */
		position: static;
	}

	.button {
		border-right: 1px solid var( --color-neutral-0 );
		color: var( --color-neutral-50 );
		height: 26px;
		margin: 6px 0;
		padding: 4px 12px;
		position: relative;
		text-transform: lowercase;
		min-width: 30px;

		&.is-tag-open {
			padding-left: 16px;
			padding-right: 8px;
			&::before {
				content: '/';
				left: 12px;
				position: absolute;
			}
		}

		&:hover {
			color: var( --color-neutral-70 );
		}

		&:last-child {
			border: none;
		}
	}
}

.editor-html-toolbar__button-insert-content {
	display: inline-block;
	height: 38px;

	.editor-html-toolbar__button-insert-content-dropdown.button {
		border-right: 1px solid var( --color-neutral-0 );
		height: 38px;
		margin: 0;
		min-width: auto;
		padding: 6px 12px 8px 10px;
		text-transform: none;

		.gridicon {
			height: 24px;
			margin-right: 4px;
			vertical-align: sub;
			width: 24px;
		}

		span {
			font-size: $font-body-small;
			font-weight: 400;
		}

		@include breakpoint-deprecated( '<660px' ) {
			padding: 6px 12px 8px;
			.gridicon {
				margin-right: 0;
			}
			span {
				display: none;
			}
		}
	}
}

.editor-html-toolbar__insert-content-dropdown {
	background-color: var( --color-surface );
	border: 1px solid var( --color-neutral-10 );
	border-radius: 0 0 4px 4px;
	display: none;
	left: 0;
	position: absolute;
	top: 38px;
	min-width: 185px;

	&.is-visible {
		display: block;
	}

	.editor-html-toolbar__insert-content-dropdown-item {
		cursor: pointer;
		display: block;
		height: 42px;
		padding: 9px 16px;

		.gridicon {
			color: var( --color-neutral-light );
		}
		span {
			color: var( --color-text-subtle );
			display: inline-block;
			font-size: $font-body-small;
			margin-left: 8px;
			margin-top: 2px;
			vertical-align: top;
		}

		&:hover {
			.gridicon, span {
				color: var( --color-accent );
			}
		}
	}
}

.editor-html-toolbar__button-strong {
	font-weight: 600;
}
.editor-html-toolbar__button-em {
	font-style: italic;
}
.editor-html-toolbar__button-a.button {
	color: var( --color-primary );
	text-decoration: underline;
}
.editor-html-toolbar__button-del {
	text-decoration: line-through;
}
.editor-html-toolbar__button-ins {
	text-decoration: underline;
}
.editor-html-toolbar__button-code {
	font-family: $code;
}
.editor-html-toolbar__button-close-tags.button[disabled]:hover {
	color: var( --color-neutral-0 );
}

.editor-html-toolbar__dialog {
	max-height: 90%;

	.dialog__content {
		min-width: 40vw;
	}
	.form-fieldset {
		margin-bottom: 8px;
	}
	.post-selector {
		margin-bottom: 16px;

		.post-selector__results {
			height: 24vh;
		}
	}

	@include breakpoint-deprecated( '<660px' ) {
		width: 90%;

		.dialog__content {
			min-width: none;
		}
	}
}
